package com.powernode.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.powernode.mapper.AttachmentMapper;
import com.powernode.domain.Attachment;
import com.powernode.service.AttachmentService;

import java.util.List;

/**
*内容: 
*作者: cy
*/   
    
   
@Service
public class AttachmentServiceImpl implements AttachmentService{

    @Resource
    private AttachmentMapper attachmentMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return attachmentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Attachment record) {
        return attachmentMapper.insert(record);
    }

    @Override
    public int insertSelective(Attachment record) {
        return attachmentMapper.insertSelective(record);
    }

    @Override
    public Attachment selectByPrimaryKey(Integer id) {
        return attachmentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Attachment record) {
        return attachmentMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Attachment record) {
        return attachmentMapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo queryAttachmentForPage(Integer page, Integer limit) {
        Page<Attachment> attachmentPage = PageHelper.startPage(page, limit);
        List<Attachment>attachmentList = this.attachmentMapper.queryAllAttachment();
        return attachmentPage.toPageInfo();


    }

}
